package com.sqb.ejb.ejb2;

import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;

@Remote
@Stateless(mappedName="EJB/CommonService")
public class CommonServiceBean implements CommonService {

	@EJB
	private MyDefalutService defaultService;

	@EJB
	private MyAnnotationService anotationService;

	@EJB
	private MySunEjbJarDescriptionService sunService;

	@Override
	public String invokeOtherEjbReturnDescription(int type) {
		String description = "";
		if (1 == type) {
			description = defaultService.defaultDescription();
		} else if (2 == type) {
			description = anotationService.annotationDescription();
		} else if (3 == type) {
			description = sunService.sunEjbJarDescription();
		} else {
			return "never call other ejbs";
		}
		return description;
	}

}
